/**
 * This is my code.
 *
 * $Id$
 */
package fi.jab.esb.config.xml.impl;

import fi.jab.esb.config.xml.JmsProviderType;
import fi.jab.esb.config.xml.XmlPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Jms Provider Type</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link fi.jab.esb.config.xml.impl.JmsProviderTypeImpl#getConnectionFactory <em>Connection Factory</em>}</li>
 *   <li>{@link fi.jab.esb.config.xml.impl.JmsProviderTypeImpl#getJndiContextFactory <em>Jndi Context Factory</em>}</li>
 *   <li>{@link fi.jab.esb.config.xml.impl.JmsProviderTypeImpl#getJndiPkgPrefix <em>Jndi Pkg Prefix</em>}</li>
 *   <li>{@link fi.jab.esb.config.xml.impl.JmsProviderTypeImpl#getJndiURL <em>Jndi URL</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class JmsProviderTypeImpl extends BusProviderImpl implements JmsProviderType
{
  /**
   * The default value of the '{@link #getConnectionFactory() <em>Connection Factory</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getConnectionFactory()
   * @generated
   * @ordered
   */
  protected static final String CONNECTION_FACTORY_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getConnectionFactory() <em>Connection Factory</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getConnectionFactory()
   * @generated
   * @ordered
   */
  protected String connectionFactory = CONNECTION_FACTORY_EDEFAULT;

  /**
   * The default value of the '{@link #getJndiContextFactory() <em>Jndi Context Factory</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getJndiContextFactory()
   * @generated
   * @ordered
   */
  protected static final String JNDI_CONTEXT_FACTORY_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getJndiContextFactory() <em>Jndi Context Factory</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getJndiContextFactory()
   * @generated
   * @ordered
   */
  protected String jndiContextFactory = JNDI_CONTEXT_FACTORY_EDEFAULT;

  /**
   * The default value of the '{@link #getJndiPkgPrefix() <em>Jndi Pkg Prefix</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getJndiPkgPrefix()
   * @generated
   * @ordered
   */
  protected static final String JNDI_PKG_PREFIX_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getJndiPkgPrefix() <em>Jndi Pkg Prefix</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getJndiPkgPrefix()
   * @generated
   * @ordered
   */
  protected String jndiPkgPrefix = JNDI_PKG_PREFIX_EDEFAULT;

  /**
   * The default value of the '{@link #getJndiURL() <em>Jndi URL</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getJndiURL()
   * @generated
   * @ordered
   */
  protected static final String JNDI_URL_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getJndiURL() <em>Jndi URL</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getJndiURL()
   * @generated
   * @ordered
   */
  protected String jndiURL = JNDI_URL_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected JmsProviderTypeImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return XmlPackage.Literals.JMS_PROVIDER_TYPE;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getConnectionFactory()
  {
    return connectionFactory;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setConnectionFactory(String newConnectionFactory)
  {
    String oldConnectionFactory = connectionFactory;
    connectionFactory = newConnectionFactory;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, XmlPackage.JMS_PROVIDER_TYPE__CONNECTION_FACTORY, oldConnectionFactory, connectionFactory));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getJndiContextFactory()
  {
    return jndiContextFactory;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setJndiContextFactory(String newJndiContextFactory)
  {
    String oldJndiContextFactory = jndiContextFactory;
    jndiContextFactory = newJndiContextFactory;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, XmlPackage.JMS_PROVIDER_TYPE__JNDI_CONTEXT_FACTORY, oldJndiContextFactory, jndiContextFactory));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getJndiPkgPrefix()
  {
    return jndiPkgPrefix;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setJndiPkgPrefix(String newJndiPkgPrefix)
  {
    String oldJndiPkgPrefix = jndiPkgPrefix;
    jndiPkgPrefix = newJndiPkgPrefix;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, XmlPackage.JMS_PROVIDER_TYPE__JNDI_PKG_PREFIX, oldJndiPkgPrefix, jndiPkgPrefix));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getJndiURL()
  {
    return jndiURL;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setJndiURL(String newJndiURL)
  {
    String oldJndiURL = jndiURL;
    jndiURL = newJndiURL;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, XmlPackage.JMS_PROVIDER_TYPE__JNDI_URL, oldJndiURL, jndiURL));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case XmlPackage.JMS_PROVIDER_TYPE__CONNECTION_FACTORY:
        return getConnectionFactory();
      case XmlPackage.JMS_PROVIDER_TYPE__JNDI_CONTEXT_FACTORY:
        return getJndiContextFactory();
      case XmlPackage.JMS_PROVIDER_TYPE__JNDI_PKG_PREFIX:
        return getJndiPkgPrefix();
      case XmlPackage.JMS_PROVIDER_TYPE__JNDI_URL:
        return getJndiURL();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case XmlPackage.JMS_PROVIDER_TYPE__CONNECTION_FACTORY:
        setConnectionFactory((String)newValue);
        return;
      case XmlPackage.JMS_PROVIDER_TYPE__JNDI_CONTEXT_FACTORY:
        setJndiContextFactory((String)newValue);
        return;
      case XmlPackage.JMS_PROVIDER_TYPE__JNDI_PKG_PREFIX:
        setJndiPkgPrefix((String)newValue);
        return;
      case XmlPackage.JMS_PROVIDER_TYPE__JNDI_URL:
        setJndiURL((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case XmlPackage.JMS_PROVIDER_TYPE__CONNECTION_FACTORY:
        setConnectionFactory(CONNECTION_FACTORY_EDEFAULT);
        return;
      case XmlPackage.JMS_PROVIDER_TYPE__JNDI_CONTEXT_FACTORY:
        setJndiContextFactory(JNDI_CONTEXT_FACTORY_EDEFAULT);
        return;
      case XmlPackage.JMS_PROVIDER_TYPE__JNDI_PKG_PREFIX:
        setJndiPkgPrefix(JNDI_PKG_PREFIX_EDEFAULT);
        return;
      case XmlPackage.JMS_PROVIDER_TYPE__JNDI_URL:
        setJndiURL(JNDI_URL_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case XmlPackage.JMS_PROVIDER_TYPE__CONNECTION_FACTORY:
        return CONNECTION_FACTORY_EDEFAULT == null ? connectionFactory != null : !CONNECTION_FACTORY_EDEFAULT.equals(connectionFactory);
      case XmlPackage.JMS_PROVIDER_TYPE__JNDI_CONTEXT_FACTORY:
        return JNDI_CONTEXT_FACTORY_EDEFAULT == null ? jndiContextFactory != null : !JNDI_CONTEXT_FACTORY_EDEFAULT.equals(jndiContextFactory);
      case XmlPackage.JMS_PROVIDER_TYPE__JNDI_PKG_PREFIX:
        return JNDI_PKG_PREFIX_EDEFAULT == null ? jndiPkgPrefix != null : !JNDI_PKG_PREFIX_EDEFAULT.equals(jndiPkgPrefix);
      case XmlPackage.JMS_PROVIDER_TYPE__JNDI_URL:
        return JNDI_URL_EDEFAULT == null ? jndiURL != null : !JNDI_URL_EDEFAULT.equals(jndiURL);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (connectionFactory: ");
    result.append(connectionFactory);
    result.append(", jndiContextFactory: ");
    result.append(jndiContextFactory);
    result.append(", jndiPkgPrefix: ");
    result.append(jndiPkgPrefix);
    result.append(", jndiURL: ");
    result.append(jndiURL);
    result.append(')');
    return result.toString();
  }

} //JmsProviderTypeImpl
